#!/usr/bin/perl

=head1 NAME

Swignition::DataModel::XMLLiteral - Represents an RDF literal of datatype rdf:XMLLiteral.

=cut

package Swignition::DataModel::XMLLiteral;

use Swignition::DataModel::Literal;

use constant TRUE      =>  1;
use constant FALSE     =>  0;
use strict;

our @ISA = ("Swignition::DataModel::Literal");
our $VERSION = '0.1';

=head1 CONSTRUCTORS

=over

=item $node = Swignition::DataModel::XMLLiteral->new($model, $string, $dt, $lang, $dom)

Create a new node. 

=cut

sub new
{
	my $class    = shift;
	my $model    = shift;
	my $string   = shift || '';
	my $datatype = shift || undef;
	my $lang     = shift || undef;
	my $dom      = shift || undef;
	
	my $this = Swignition::DataModel::Literal::new(__PACKAGE__, $model, $string, $datatype, $lang);
	
	$this->set_dom($dom);
	
	return $this;
}

=back

=head1 PUBLIC METHODS

C<Swignition::DataModel::XMLLiteral> also inherits from
C<Swignition::DataModel::Literal>.

=over

=item $node->dom

Get the XML::LibXML::Node that this literal represents.

=cut

sub dom
{
	my $this = shift;
	return $this->{'_'}->{'dom'};
}

=item $node->set_dom($dom)

Set the XML::LibXML::Node that this literal represents.

=cut

sub set_dom
{
	my $this = shift;
	my $dom  = shift;

	$this->{'_'}->{'dom'} = $dom;

	return $this;
}

=back

=cut

1;

